/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author wangyu
* @date 2024-05-21
**/
@Entity
@Data
@Table(name="course_applicants")
public class CourseApplicants implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = "主键ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Column(name = "course_no")
    @ApiModelProperty(value = "课程编号")
    private String courseNo;
    
    @Column(name = "course_name")
    @ApiModelProperty(value = "课程名称")
    private String courseName;

    @Column(name = "open_id")
    @ApiModelProperty(value = "用户openId")
    private String openId;

    @Column(name = "real_name")
    @ApiModelProperty(value = "用户名称")
    private String realName;

    @Column(name = "mobile")
    @ApiModelProperty(value = "手机号")
    private String mobile;

    @Column(name = "create_time")
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "nick_name")
    @ApiModelProperty(value = "用户昵称")
    private String nickName;

    @Column(name = "paid")
    @ApiModelProperty(value = "是否支付")
    private Integer paid;

    @Column(name = "consume")
    @ApiModelProperty(value = "是否核销")
    private Integer consume;

    @Column(name = "order_no")
    @ApiModelProperty(value = "订单号")
    private String orderNo;

    @Column(name = "expire_time")
    @ApiModelProperty(value = "过期时间")
    private Timestamp expireTime;

    @Column(name = "oneself")
    @ApiModelProperty(value = "是否本人")
    private Integer oneself;

    @Column(name = "sign_status")
    @ApiModelProperty(value = "签到状态，0：未签到，1：线上签到，2：线下补录，3：过期")
    private Integer signStatus;

    @Column(name = "modify_flag")
    @ApiModelProperty(value = "修改标识")
    private String modifyFlag;

    @Column(name = "referee")
    @ApiModelProperty(value = "推荐人")
    private String referee;

    @Column(name = "repair_url")
    @ApiModelProperty(value = "补录图")
    private String repairUrl;

    public void copy(CourseApplicants source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}